package 多态案例;

import com.sun.xml.internal.ws.api.model.wsdl.WSDLOutput;

public class computer {
    private String name;

    public computer(String name) {
        this.name = name;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }
    public void start(){
        System.out.println();
    }
    public void install(USB a){
        if(a instanceof jianpan){
            jianpan t=(jianpan)a;
            System.out.println(t.getName()+"键盘成功安装到"+this.name+"电脑");
        }else if(a instanceof shubiao){
            shubiao t=(shubiao) a;
            System.out.println(t.getName()+"鼠标成功安装"+this.name+"电脑");
        }
    }
}
